package com.joy.web.admin.service;

import com.joy.web.admin.entity.Resource;
import com.joy.common.model.vo.ResourceVO;
import com.joy.web.base.service.IBaseService;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yjzhao
 * @since 2019-09-16
 */
public interface IResourceService extends IBaseService<Resource> {

    /**
     * @Description 获取权限树
     * @param
     * @return
     * @Author yjzhao
     * @Date 2019/9/16 16:33
     **/
    List<ResourceVO> getResourceTree() throws Exception;

    /**
     * @Description 获取用户所有权限
     * @param userNm
     * @return
     * @Author yjzhao
     * @Date 2019/9/17 16:03
     **/
    Set<String> getPermissionsByUserNm(String userNm) throws Exception;

    /**
     * @Description 根据用户名获取用户有权限的 menu 列表
     * @param userNm
     * @return
     * @Author yjzhao
     * @Date 2019/9/17 16:13
     **/
    List<ResourceVO> getMenuTreeByUserNm(String userNm) throws Exception;

    /**
     * @Description 将所有resource 放入缓存中
     * @param
     * @return
     * @Author yjzhao
     * @Date 2019/9/18 11:09
     **/
    void initAllResourceToCache() throws Exception;

}
